﻿<Window x:Class="AzureStorageExplorer.EntityFilter"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:controls="clr-namespace:AzureStorageExplorer"
        Title="Filter Entity List" Height="406" Width="500" ResizeMode="NoResize"
        WindowStartupLocation="CenterOwner">
    <StackPanel Orientation="Vertical">
        <StackPanel Margin="12" Orientation="Vertical">

            <TextBlock Margin="0,0,0,0">Use this tab to filter the entity list.</TextBlock>
            
            <TextBlock Margin="0,12,0,0" Text="Maximum number of records to display:"></TextBlock>
            <AdornerDecorator>
                <TextBox x:Name="MaxEntityCount" Margin="0,2,0,0" Width="220" HorizontalAlignment="Left" Background="LightYellow">
                    <controls:WatermarkService.Watermark>
                        <TextBlock>Enter a count (blank for all)</TextBlock>
                    </controls:WatermarkService.Watermark>
                </TextBox>
            </AdornerDecorator>
            
            <!-- TODO: allow column = value query conditions -->
            <TextBlock Margin="0,12,0,0" Text="Only list entities containing this text:"></TextBlock>
            <TextBox x:Name="EntityText" Margin="0,2,0,0" Background="LightYellow"></TextBox>

            <TextBlock Margin="0,8,0,0">Column visibility:</TextBlock>
            
            <ListBox x:Name="ListBoxEntityColumns" ItemsSource="{Binding EntityColumns}"  Height="100">
                <ListBox.ItemTemplate>
                    <HierarchicalDataTemplate>
                        <CheckBox Content="{Binding Name}" IsChecked="{Binding IsChecked}"/>
                    </HierarchicalDataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>

            <StackPanel x:Name="ColumnsButtonPanel" Orientation="Horizontal"  Margin="0,4,0,0">
                <Button x:Name="CmdSelectAllColumns" Padding="4" Margin="0,0,8,0" Click="CmdSelectAllColumns_Click">Select All</Button>
                <Button x:Name="CmdClearAllColumns" Padding="4" Margin="0,0,8,0" Click="CmdClearAllColumns_Click">Clear All</Button>
            </StackPanel>

            <CheckBox x:Name="SaveAsDefaultFilter" Margin="0,12,0,0">Save this as my default filter</CheckBox>
            
            <StackPanel x:Name="ButtonPanel" Orientation="Horizontal"  Margin="0,12,0,0">
                <Button x:Name="CmdApply" Padding="4" IsDefault="True" Margin="0,0,8,0" Click="CmdApplyClick">Apply</Button>
                <Button x:Name="CmdClearAllFilters" Padding="4" Margin="0,0,8,0" Click="CmdClearAllFilters_Click">Clear All Filters</Button>
                <Button x:Name="CmdCancel" Padding="4" IsCancel="true" Click="CmdCancel_Click">Cancel</Button>
            </StackPanel>
        </StackPanel>
    </StackPanel>
</Window>
